const win: any = window;
const doc: any = document;
// 监听浏览器切换标签页
doc.addEventListener("visibilitychange", () => {
  if (doc.visibilityState === "hidden")
    console.log("当前页签隐藏，即打开新页签");
  if (doc.visibilityState === "visible")
    console.log("当前页签显示，即打开当前页签");
});

// 监听浏览器关闭、刷新
win.addEventListener("beforeunload", () => {
  console.log("触发beforeunload --->>>");
  // cache.local.clear();
});

export default {};
